<?php
/**
 * Created by PhpStorm.
 * User: eugene
 * Date: 2018/4/23
 * Time: 17:15
 */

namespace App\Transformers;


class GiftTransformer extends Transformer
{
    
    public function transform($item)
    {
        return [
            'category'=>$item->category,
            'name'=>$item->name,
            'desc'=>$item->desc,
            'img'=>$item->img?:'http://h5.etzk.com/public/img/gifts/gift.png',
        ];
    }
    
    public function forLottery($item)
    {
        return [
            'category'=>$item->category,
            'name'=>$item->name,
            'desc'=>$item->desc,
            'img'=>$item->img?:'http://h5.etzk.com/public/img/gifts/gift.png',
            'attr'=>null,
        ];
    }
    
}